

package com.library.controller;

import com.library.common.base.ApiResult;
import com.library.service.BookDataTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 图书大类
 *
 * @author pig
 * @date 2023-09-25 11:09:20
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("ruralLibrary/bookDataType" )
@Api(tags = "图书大类管理", value = "图书大类管理")
public class BookDataTypeController {

    @Resource
    private BookDataTypeService bookDataTypeService;

    @ApiOperation(value = "查询")
    @GetMapping("/page" )
    public ApiResult getbookDataTypePage() {
        return ApiResult.ok(bookDataTypeService.list());
    }

    /**
     * @return ApiResult
     */
    @ApiOperation(value = "同步" )
    @PostMapping
    public ApiResult save() {
        return bookDataTypeService.synchronization();
    }

    @GetMapping("/list")
    public ApiResult list(){
        return ApiResult.ok(bookDataTypeService.list());
    }



}
